package com.juku2024.juku.viewmodel

import com.juku2024.juku.model.UpgradeResponse
import com.juku2024.juku.network.api.Api
import com.juku2024.juku.network.retrofit.OnRetrofitResultListener
import com.juku2024.juku.network.retrofit.RetrofitUtils
import com.juku2024.juku.request.CheckAppRequest
import com.juku2024.juku.tools.MD5Utils

class SettingViewModel : BaseViewModel() {

    fun doHttpUpgrade(callback: OnRetrofitResultListener<UpgradeResponse>) {
        doBaseHttp({
            val appId = getAppId()
            val appKey = getAppKey()
            val timestamp = getSecondTimestamp()
            val sign = MD5Utils.getMD5String(appId, appKey, timestamp, getExtra())
            val params = CheckAppRequest(appId, timestamp, sign)
            return@doBaseHttp RetrofitUtils.instance.getApi(Api::class.java).getUpdateV2(appId, getCommonRequest(params))
        }, callback)
    }



}